from math import sqrt
from typing import List, Tuple, Dict
import sys
def LMI() -> List[int]:
    """Read multiple integers from input"""
    return list(map(int, input().split()))

def LMF() -> List[float]:
    """Read multiple floats from input"""
    return list(map(float, input().split()))

def LI(n: int) -> List[str]:
    """Read n strings from input"""
    return [input() for _ in range(n)]

def RIM(rows: int, cols: int) -> List[List[int]]:
    """Read a matrix of integers"""
    return [LMI() for _ in range(rows)]

def MII():
    """Read multiple integers from input as a map"""
    return map(int, sys.stdin.readline().split())

def II():
    """Read a single integer from input"""
    return int(sys.stdin.readline())

def FI():
    """Read a single float from input"""
    return float(sys.stdin.readline())

        
def solve() -> None:
    def check(a,b,c,d):
        return a*a+b*b+c*c+d*d
    try:
        n = II()
        i,j,k = 0,0,0
        while True:
            if check(i,i,i,i)>n:
                break
            while True:
                if check(i,j,j,j)>n:
                    break
                while True:
                    if check(i,j,k,k)>n:
                        break
                    d = int(sqrt(n - check(i,j,k,0)))
                    if check(i,j,k,d)==n:
                        print(i,j,k,d)
                        return
                    k+=1
                k=0
                j+=1
            j=0
            i+=1
        

        
    except (EOFError, KeyboardInterrupt):
        pass

# =============================================================================
# MAIN EXECUTION
# =============================================================================

if __name__ == "__main__":
    # For multiple test cases, uncomment:
    # t = int(input())
    # for _ in range(t):
    #     solve()
    
    # For single test case:
    solve()
# 